#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    int T;
    scanf("%d", &T);
    while(T--){
        int a, b;
        scanf("%d%d", &a, &b);
        while(a || b){
            if(a){
                printf("0");
                a --;
            }
            if(b){
                printf("1");
                b --;
            }
        }
        printf("\n");
    }

    return 0;
}